package com.fit.beans;

import java.util.Date;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.fit.interfaces.CarI;
import com.fit.interfaces.ClientI;

@Entity
public class CarBean implements CarI {

	@Id
	@GeneratedValue
	private Long CarID;
	@Column(nullable = false)
	private String companyName;
	@Column(nullable = false)
	private String modelName;
	
	@Column(nullable = false)
	private String chassisNumber;
	
	@Temporal (TemporalType.DATE)
	private Date yearOfProduct;
	
	@OneToMany(targetEntity = ClientBean.class, mappedBy = "car")
	private List<ClientI> clients;

	public List<ClientI> getClients() {
		return clients;
	}

	public void setClients(List<ClientI> users) {
		this.clients = users;
	}

	/* (non-Javadoc)
	 * @see com.fit.beans.CarI#getCarID()
	 */
	public Long getCarID() {
		return CarID;
	}

	/* (non-Javadoc)
	 * @see com.fit.beans.CarI#setCarID(java.lang.Long)
	 */
	public void setCarID(Long carID) {
		CarID = carID;
	}

	/* (non-Javadoc)
	 * @see com.fit.beans.CarI#getCompanyName()
	 */
	public String getCompanyName() {
		return companyName;
	}

	/* (non-Javadoc)
	 * @see com.fit.beans.CarI#setCompanyName(java.lang.String)
	 */
	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	/* (non-Javadoc)
	 * @see com.fit.beans.CarI#getModelName()
	 */
	public String getModelName() {
		return modelName;
	}

	/* (non-Javadoc)
	 * @see com.fit.beans.CarI#setModelName(java.lang.String)
	 */
	public void setModelName(String modelName) {
		this.modelName = modelName;
	}

	/* (non-Javadoc)
	 * @see com.fit.beans.CarI#getChassisNumber()
	 */
	public String getChassisNumber() {
		return chassisNumber;
	}

	/* (non-Javadoc)
	 * @see com.fit.beans.CarI#setChassisNumber(java.lang.String)
	 */
	public void setChassisNumber(String chassisNumber) {
		this.chassisNumber = chassisNumber;
	}

	/* (non-Javadoc)
	 * @see com.fit.beans.CarI#getYearOfProduct()
	 */
	public Date getYearOfProduct() {
		return yearOfProduct;
	}

	/* (non-Javadoc)
	 * @see com.fit.beans.CarI#setYearOfProduct(java.util.Date)
	 */
	public void setYearOfProduct(Date yearOfProduct) {
		this.yearOfProduct = yearOfProduct;
	}
	
	
}
